home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / holdit10.zip / HOLDIT.DOC < prev    next >
Text File  |  1993-05-05  |  3KB  |  67 lines

  1.  
  2.   HoldIt.exe -- The program basically does the same as the DOS command
  3.   PAUSE.  The first difference is that a timeout value can be given as
  4.   a parameter specifying the number of seconds the program  will  wait
  5.   for  somebody  to hit a key before continuing. (0 or no parameter at
  6.   all makes the program wait indefinitely) But what would that be good
  7.   for  without  the second difference: the returned errorlevels. If no
  8.   user interaction  is  registered  during  the  specified  time,  the
  9.   program  ends  returning the errorlevel 0. If any key is pressed the
  10.   program exits immediately and returns an errorlevel that depends  on
  11.   the  key  that  has  been  hit. In the current version the following
  12.   codes will be returned:
  13.  
  14.   Key:    1  2  3  4  5  6  7  8  9   0  ESC   any other key
  15.   Code:   1  2  3  4  5  6  7  8  9  10  200       100
  16.  
  17.   The  program  was  written  in  Turbo  Pascal 6.0 with a tiny bit of
  18.   assembler in it, as can easily be seen in  the  accompanying  source
  19.   code.  The  timeout delay is realized with the internal clock of the
  20.   PC: that way 5 seconds are 5 seconds -  no  matter  how  'slow'  the
  21.   machine  is  running.  Since the date has not been incorporated into
  22.   this check the timed delay might be shorter than  specified  if  the
  23.   time changes from 23:59 to 00:00 during the 'pause'.
  24.  
  25.   This  program  was uploaded by the author; I DO NOT claim any rights
  26.   whatsoever and encourage everybody to  adapt  the  code  to  his/her
  27.   personal  needs.  No  payments  are asked for, you may use it for as
  28.   long as you please and do with it whatever you like. I would however
  29.   be glad if anyone testing, using and/or modifying this program would
  30.   send me a short notice -- just because I'd like to have an  idea  of
  31.   how far it is getting around.
  32.  
  33.   I cannot give a guarantee that the program will perform in the above
  34.   outlined manner on a given system, but  it  has  been  tested  under
  35.   MSDOS 5.0 on 286/386/486 cpus. If an error should occur a recompila-
  36.   tion of the provided source code should do the trick.
  37.  
  38.   Some points of interest:
  39.  
  40.   - Don't forget that in a batchfile you always have to check for  the
  41.     highest errorlevel first: "If errorlevel = 1" returns true even if
  42.     the level actually is >= 2.
  43.  
  44.   - The message 'Press any key to continue'  is  written  to  standard
  45.     output (normally the screen). This way it can be redirected to NUL
  46.     if you'd rather have some other message displayed instead.
  47.     (e.g. echo Press ESC to abort
  48.           holdit 5 > NUL
  49.           if errorlevel = 200 goto end
  50.     )
  51.  
  52.   - If you need other (or more) errorlevels, you can add  the  desired
  53.     keys  and  levels  to the CASE statement at the end of the program
  54.     and recompile it afterwards. Or you  can  get  in  touch  with  me
  55.     (preferrably via e-mail).
  56.  
  57.   - I'm  open  to suggestions. Feel free to contact me if you have any
  58.     questions or ideas for improvements.
  59.  
  60.  
  61.   Peter Strickler
  62.   HWS, University of Zuerich
  63.   Zuerich / Switzerland
  64.   K267514@CZHRZU1A.BITNET
  65.  
  66.  
  67.